package Demo07;

import Demo03.User;
import Demo03.UserDAOImpl;
import com.opensymphony.xwork2.ActionSupport;

public class UserAction_Login extends ActionSupport {
    private User user;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
    @Override
    public String execute() throws Exception {
        String u=new UserDAOImpl().SelUser(user.getUsername());
//        System.out.println(u+"::" + user.getPassword());
        if (u!=null&&u.equals(user.getPassword()))
             return SUCCESS;
        else
            return "fail";
    }
}
